import { EncodeRulesService } from './../../../../../@core/services/encoderRule/encode-rules.service';
import { User } from './../../../../../@core/data/user';
import { Component, Input } from '@angular/core';
import { CascaderItem } from 'ng-devui';
@Component({
  selector: 'app-add-position-data',
  templateUrl: './add-position-data.component.html',
  styleUrls: ['./add-position-data.component.scss']
})
export class AddPositionDataComponent {
  @Input() data: any;
  options :any;//部门
  positionData={
    positionNum: "",
    warehouseId: 0,
    positionName: "",
    isEnabled: true,
    userID: null
  };//分类类目
  items:any[]=[
    '启用', '禁用'
  ];
  currentSelectedItem = '启用';
  constructor(private EncodeRulesService:EncodeRulesService){}
  ngOnInit(): void{
    this.positionData.isEnabled = this.currentSelectedItem == '启用' ? true : false
    this.positionData.warehouseId = this.data.warehouseId
    this.EncodeRulesService.GenerateWarehouseCodeRule('仓位编码','仓位编码').subscribe((res:any)=>{
      this.positionData.positionNum = res
    })
  }
  valueChange(value: string): void {
    this.positionData.isEnabled = value == '启用' ? true : false
  }
}
